import { AxiosRequestConfig } from "axios";
import request from "../base";

const organizationURL = '/organizationManage/admin'

// 获取社团列表
export const getList = (params: IObj) => {
  return request.get(`${organizationURL}/getList`, {
    params
  });
}

export const getAll = (params: IObj) => {
  return request.get(`${organizationURL}/getAll`, {
    params
  });
}

// 添加社团
export const addCommittee = (data: IObj) => {
  return request.post(`${organizationURL}/addOrganization`, data);
}

// 编辑社团
export const editOrganization = (data: IObj) => {
  console.log(data);
  return request.post(`${organizationURL}/editOrganization`, data);
}

// 删除社团
export const deleteOrganization = (id: number) => {
  return request.delete(`${organizationURL}/deleteOrganization`, {
    params: {
      id
    }
  })
}

// 批量删除社团
export const deleteOrganizationByList = (data: number[]) => {
  return request.delete(`${organizationURL}/deleteOrganizationByList`, {
    data
  });
}

// 下拉框获取社团
export const getOrganization = () => {
  return request.get(`/organizationManage/getOrganization`);
}